<table border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td valign="top">
	<div class="Col">
	<tal:block tal:content="structure php: this.partial('index/myactivity.html')"/>
	</div>
	</td>
	<td valign="top"><div class="Col">
		<div class="ModuleBlock">
			<h1>
			<label>Messages - Settings</label>
<div><a href="/expressions/index/inbox/1"  ><img src="/images/HomeIcon.png" alt="Expression Home" border="0" align="top" class="SetIcon" title="Expression Home"/></a></div>
</h1>
<div class="clear"></div>
<ul class="ModuleMenu">
<li><a href="/expressions/index/groups/7">Groups</a> </li>
<li><a href="/expressions/index/block/6">Block</a> </li>
<li><a href="/expressions/index/anonymous/5" class="active">Anonymous</a> </li>
</ul>
<div class="clear hig20"></div>
<div id="messageDis" style="color:red;padding:5px 5px;"></div>
<div class="ModuleHig">
<div class="pad_18 txt_sm">Display Anonymous Messages?&nbsp;&nbsp;<?php if($ctx->count>=1){ ?>
<input type="radio" name="radio" value="yes" onchange="changeShowAnonymousStatus(this)" />&nbsp;&nbsp;Yes&nbsp;&nbsp;<input type="radio" name="radio" value="no" checked="checked" onchange="changeShowAnonymousStatus(this)"/>&nbsp;&nbsp;No
<?php } else { ?>
<input type="radio" name="radio" value="yes" checked="checked" onchange="changeShowAnonymousStatus(this)" />&nbsp;&nbsp;Yes&nbsp;&nbsp;<input type="radio" name="radio" value="no" onchange="changeShowAnonymousStatus(this)"/>&nbsp;&nbsp;No
<?php }?>
</div>
<div class="pad_t15 pad_15 txt_sm"><div class="Fleft pad_15"><input name="Check_All" type="checkbox" id="Check_All" onClick="CheckAll(document.getElementsByName('check_list[]'))"/><label style="margin:-5px 0 5px 5px;">Check All</label>
   </div>
   </div>
<div class="clear"></div>

<div class="blkCont">
<?php if(is_array($ctx->getExpressions['result']) && count($ctx->getExpressions['result'])>0) { ?>
				
					<tal:block tal:content="structure php: this.partial('/index/message.html')"/>
				
				<? } else { ?>
				<strong>No Messagesin Anonymous</strong>
				
				<? } ?>	
</div>
<div class="clear"></div>
<div class="pad_t15 pad_115"><a class="Button" href="javascript:void(0);" onclick="changeStatus('RDelete','');"><span>Delete</span></a></div>

</div>
<div id="downPagerId" class="paginat" style="padding-right:15px;"></div>
<div class="clear"></div>
</div>
</div></td>
	<td valign="top">
	<tal:block tal:omit-tag="" tal:content="structure php: this.action('index','activity','expressions')" /></td>
	<td valign="top">
	<div class="ColBanner">
	<div class="ModuleBlock">
	<img src="/images/Gads.gif" /><img src="/images/Gads.gif" /></div>
	</div></td>
  </tr>
</table>
<script>
	//<![CDATA[
	pagination = new Array();
	pagination['currentPage'] = "<?=$ctx->getExpressions['currentPage']?>";
	pagination['resultsPerPage'] = "<?=$ctx->getExpressions['resultPerPage']?>";
	pagination['pages'] = "<?= $ctx->getExpressions['pages']?>";  
	pagination['pager'] = '<?=$ctx->getExpressions["pager"]?>';
	pagination['resultsCount'] = "${getExpressions/resultsCount}" ;
	
	var Params='${params}';
	//alert(pagination['resultsCount']+'  '+Params);
	var requestUrl = "/expressions/index/pagination/<?php echo $ctx->type;?>/";
	$(document).ready(function () {
	   setPagination(pagination['resultsCount'],'','downPagerId','','');
	});
function CheckAll(chk)
{
	if(document.getElementById('Check_All').checked)
	{
		var ids="";
		for (i = 0; i < chk.length; i++){
		chk[i].checked = true ;
		}
	}
	else
	{
		for (i = 0; i < chk.length; i++)
		chk[i].checked = false ;
	}
}
function changeShowAnonymousStatus(obj)
{
	//alert(obj.value);return false;
	var status=obj.value
	$.ajax({
			   
			   type: "POST",
			   dataType: "json",
			   data: "status="+status,
			   url: "/expressions/index/anonymous-status/",
			    success: function(data){
					//alert(data.output);return false;
						$('#messageDis').html('Settings Saved');
					}


			});
}
function changeStatus(valStatus,ind)
{
	//alert(valStatus+' '+ind);return false;
	if(ind=='') {
		var val = '';
		$('#check_list:checked').each(function(i){
		  val+= $(this).val()+',';
		});
		if(val == '')
		{
			alert('Please select a group');
			return false;
		}
	} else {
		val = ind;
	}
	//alert(val);return false;
	//alert("checked"+val);return false;
	$.ajax({
			   
			   type: "POST",
			   dataType: "json",
			   data: "val="+valStatus+"&values="+val,
			   url: "/expressions/index/delete-anonymous/",
			    success: function(data){
					//alert(data.output);return false;
					location.reload();					
					}


			});
	
}
function showDiv(type)
{
	if(type == 'r')
	{
		$('#rec').addClass("active");
		$('#sent').removeClass("active");
		$('#sentId').hide();
		$('#recId').show();
	} else {
		//alert(type);
		$('#rec').removeClass("active");
		$('#sent').addClass("active");
		$('#sentId').show();
		$('#recId').hide();
	}

}

	//]]>
</script>



